# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python2-tldextract
_pkgname=tldextract
pkgver=2.2.2
pkgrel=1
pkgdesc='Accurately separates the gTLD or ccTLD (generic or country code top-level domain) from the registered domain and subdomains of a URL.'
arch=('any')
url='https://github.com/john-kurkowski/tldextract'
license=('custom:BSD')
depends=('python2' 'python2-requests-file')
makedepends=('python2-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('21c1098e62056fd5d68c0bf94a151be4224055eabf7973fee85d3632c0b509b454c5f990bd80db3d62fb5ac64b0592a3d3db62445fe5950f3bf9be75aa488ec1')

build() {
  cd "$_pkgname-$pkgver"

  python2 setup.py build
}

package() {
  cd "$_pkgname-$pkgver"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build

  mv "$pkgdir/usr/bin/tldextract" "$pkgdir/usr/bin/tldextract2"
}

